package com.gadgets.busi.bm05.controller;

import com.gadgets.busi.bm05.common.SvnKetTagsRequestDTO;
import com.gadgets.busi.bm05.fegin.ISvnKitController;
import com.gadgets.framework.annotation.RoleAuthCheck;
import com.gadgets.framework.common.dto.HttpBaseResp;
import com.gadgets.framework.common.exception.GadgetsServiceException;
import com.gadgets.framework.common.util.FeginRequestMapUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;

/**
 * @author UncleXiu
 * @version V1.0.0
 * @data 2022-03-02
 */
@RestController
@RequestMapping(value = "/bm05")
public class GdagetsBm05Fork {

    @Autowired
    private ISvnKitController svnKitController;

    @RoleAuthCheck
    @RequestMapping(value = "/tagScan.do")
    public HttpBaseResp<String> scanTagsFile(HttpServletRequest request, HttpServletResponse response,final SvnKetTagsRequestDTO tagsRequestDTO) throws GadgetsServiceException {
        HashMap<String ,Object> requestParam = new HashMap<>();
        FeginRequestMapUtil.parseRequestParam(tagsRequestDTO, requestParam);
        return svnKitController.scanTagsFile(requestParam);
    }

}
